package com.dinglian.ots.dao.mapper;

import com.dinglian.ots.dao.model.Product;
import com.dinglian.ots.dao.model.ProductExample;
import java.util.List;
import java.util.Map;

import com.dinglian.ots.vo.product.ProductDetailVo;
import com.dinglian.ots.vo.product.ProductListVo;
import com.dinglian.ots.vo.product.ProductRankVo;
import com.dinglian.ots.vo.product.ProductVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

public interface ProductMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int countByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int deleteByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int insert(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int insertSelective(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    List<Product> selectByExampleWithBLOBsWithRowbounds(ProductExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    List<Product> selectByExampleWithBLOBs(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    List<Product> selectByExampleWithRowbounds(ProductExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    List<Product> selectByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    Product selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") Product record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByExampleWithBLOBs(@Param("record") Product record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") Product record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByPrimaryKeyWithBLOBs(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ots_product
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(Product record);

    /**
     * 获取产品列表
     * @param brandId
     * @param categoryId
     * @param keyword
     * @return
     */
    List<ProductVo> getProductList(@Param("brandId") Integer brandId, @Param("categoryId") Integer categoryId, @Param("keyword")String keyword,@Param("pageNum")Integer pageNum,@Param("pageSize")Integer pageSize);

    /**
     * 获取推荐产品
     * @param categoryId
     * @return
     */
    List<ProductVo> getRecommendProduct(@Param("categoryId")Integer categoryId);

    /**
     * 获取产品详情
     * @param userId
     * @param productId
     * @return
     */
    Map getProductInfo(@Param("userId") Integer userId, @Param("productId") Integer productId);

    /**
     * 获取产品颜色
     * @param productId
     * @return
     */
    String selectProductColor(@Param("productId") Integer productId);

    /**
     * 获取品牌下的产品列表
     * @param name
     * @param stylename
     * @param title
     * @param seasonId
     * @param categoryId
     * @param subcategoryId
     * @param isShow
     * @param status
     * @param upperDate
     * @param downDate
     * @return
     */
    List<ProductListVo> getProductListByBrand(@Param("brandId")Integer brandId, @Param("name") String name, @Param("stylename") String stylename, @Param("title") String title, @Param("seasonId") Integer seasonId,
                                              @Param("categoryId") Integer categoryId, @Param("subcategoryId") Integer subcategoryId, @Param("isShow") Integer isShow,
                                              @Param("status") Integer status, @Param("upperDate") String upperDate, @Param("downDate") String downDate);

    /**
     * 获取商品详情
     * @param productId
     * @return
     */
    ProductDetailVo getProductDetail(@Param("productId") Integer productId);

    /**
     * 获取产品排行
     * @param brandName
     * @param title
     * @param styleName
     * @param isRecommend
     * @param startTime
     * @param endTime
     * @return
     */
    List<ProductRankVo> getProductRankList(@Param("brandName") String brandName, @Param("title")String title, @Param("styleName")String styleName, @Param("isRecommend")Integer isRecommend,
                                           @Param("startTime")String startTime, @Param("endTime")String endTime);

    /**
     * 获取最小订量
     * @param productId
     * @return
     */
    Map getMiniQty(@Param("productId") Integer productId);

    /**
     * 查询产品页数
     * @param brandId
     * @param categoryId
     * @param keyword
     * @return
     */
    int getProductCount(@Param("brandId") Integer brandId, @Param("categoryId") Integer categoryId, @Param("keyword")String keyword);
}